//headers 
#include<algorithm>
#include<cassert>
#include<cstdio>
#include<queue>
#include<deque>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<deque>
#include<set>
#include<string>
#include<sstream>
#include<stack>
#include<streambuf>
#include<vector>
using namespace std;

//macros
#define LET(x,a) typeof(a) x(a)
#define FOR(i,a,n) for(LET(i,a);i!=n;i++)
#define REP(i,n) FOR(i,0,n)
#define sz size()
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define PRINT(x) REP(_,x.sz) cout<<x[_]<<" "; cout<<endl;
const int INF = (int) 1e8;
#define VI vector<int>
#define VS vector<string>
#define VVI vector< vector<int> >
#define PII pair<int,int>
#define VII vector< PII >
#define LL long long
#define mp make_pair


//code of suren

int main(){
  int n,m ;
  while(cin>>n>>m){
    if( m == 1 || m == 0 || n<m) { cout<<"Boring!"<<endl; continue; }
    VI a; a.pb(n);
    bool flag=true;
    while( n != 1 ){
      if( n%m != 0 ) { cout<<"Boring!"; flag=false; break; }
      else { n/=m; a.pb(n); }
    }
    REP(i,a.sz-1) if( a[i]<=a[i+1] ) { flag=false; break; }
    if(flag) REP(i,a.sz) { cout<<a[i]; if(i != a.sz-1) cout<<" "; } 
    cout<<endl;
  }
  return 0;
}
